package Search;


/**
 * 线性查找
 * XD-RedMi14 2025/03/07
 */
public class Linear {

    public static <T> int search(T[] input, T target) {
        for (int i = 0; i < input.length; i++) {
            if (input[i].equals(target)) {
                return i;
            }
        }
        return -1;
    }
}
